<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>OA管理系统</title>
		<link rel="stylesheet"
			href="../styles/style.css" type="text/css" />
		<script>
			function addUser() {
				location.href = "http://localhost:8080/files/yonghuadd.jsp";
			}
		</script>
		<script>
			function btn1(){
				var checkboxObj = document.getElementsByClassName("cks");
				var cks = [];
				for (var i = 0; i < checkboxObj.length; i++) {
					if (checkboxObj[i].checked == true) {
						cks.push(checkboxObj[i].value)
					}
				}
				if (confirm("您确定要删除选中的条目吗?")) {
					location.href = "http://localhost:8080/delUsersByids?ids="+cks;
				}
			}
		</script>
	</head>
	<body>
		<div id="main_body">
			<!-- ----------用户结构start -------------------------->

			
			<br>
			<br>
			<!-- ----------用户结构end -------------------------->


			<!--******************************************** -->
			<ul class="main_top">
				<li class="main_top_left left">
					用户列表
					<BR>
				</li>

			</ul>
			<form name="form1" method="post" action="user_delAll"
				onsubmit="return doSubmit();">
				<div class="main_content_rightbg">
					<div class="main_content_leftbg">
						<table width="80%" border="0" align=center cellpadding="2"
							cellspacing="1" bgcolor="#FFFFFF" class="border">
							<tr>
								<td  align="center" nowrap class="tdbg">
									<strong>选择</strong>
								</td>
								<td  align="center" class="tdbg">
									<strong>用户名称</strong>
								</td>
													
								<td  align="left" class="tdbg">
									<div align="center">
										<strong>性别</strong>
									</div>
								</td>
								<td  align="center" class="tdbg">
									<strong>密码</strong>
								</td>
								<td w align="center" nowrap class="tdbg">
									<strong>部门</strong>
								</td>
								
								<td  align="center" class="tdbg">
									<strong>角色</strong>
								</td>

								
								<td  align="center" nowrap class="tdbg">
									<strong>创建日期</strong>
								</td>
							

								<td align="center" class="tdbg">
									<STRONG>操作：</STRONG>
								</td>
							</tr>
							<c:forEach items="${userInfo.list}" var="u">

								<tr>
									<td align="center" class="tdbg">
										<input type="checkbox"   name="checkbox" value="${u.id}" class="cks"/>
									</td>
									<td align="left" class="tdbg">
										${u.user_name}
									</td>
									<td align="left" class="tdbg">
										${u.user_sex}
									</td>
									<td align="center" class="tdbg">
										${u.user_password}
									</td>


									<td width="5%" align="center" class="tdbg">
										${u.user_department}
									</td>
									<td align="center" class="tdbg">
										${u.user_role}
									</td>
									<td align="center" class="tdbg">
										${u.create_date}
									</td>
									
									<td align="center" class="tdbg">
										<A href="${pageContext.request.contextPath}/findUserById?id=${u.id}">修改</A> &nbsp;&nbsp;&nbsp;
										<a href="${pageContext.request.contextPath}/delUserById?id=${u.id}">删除</a>
									</td>
								</tr>
							</c:forEach>
						</table>

					</div>
				</div>

				<table width="80%" border="0" align=center cellpadding="0"
					cellspacing="0" bgcolor="#FFFFFF">
					<tr>
						<td width="10%" align="left" class="tdbg">
							<INPUT id="chkAll" type="checkbox" value="checkbox" name="chkAll"
								>
							全选
						</td>
						<td width="90%" align="center" class="tdbg">
							<STRONG>操作：</STRONG>
							<input type="button" class="newButton" onclick="btn1()" value="删除选定">

							<INPUT type="button" value="添加" name="Submit1" class="newButton"
								   onclick='addUser()'>
						</td>
					</tr>
				</table>
			</form>
			<table width="80%" border="0" align=center cellpadding="2"
				cellspacing="0" bgcolor="#FFFFFF" class="border">
				<tr>
					<td height="40" align="center" class="tdbg">
						<p>
							当前第${userInfo.pageNum}页，总${userInfo.pages}页,总${userInfo.total}条记录
						</p>
						<a href="yonghuxinxi?pageNo=${userInfo.navigateFirstPage}">首页</a>
						<c:if test="${userInfo.hasPreviousPage }">
							<a href="yonghuxinxi?pageNo=${userInfo.pageNum-1}">上一页</a>
						</c:if>
						<c:forEach begin="1" end="${userInfo.pages}" var="i">
							<a href="yonghuxinxi?pageNo=${i}">${i}</a>
						</c:forEach>
						<c:if test="${userInfo.hasNextPage }">
							<a href="yonghuxinxi?pageNo=${userInfo.pageNum+1}">下一页</a>
						</c:if>
						<a href="${pageContext.request.contextPath}/yonghuxinxi?pageNo=${userInfo.navigateLastPage}">尾页</a>
					</td>
				</tr>
			</table>
		</div>
		
		<ul class="main_end">
			<li class="main_end_left left"></li>
			<li class="main_end_right right"></li>
		</ul>
	</body>
</html>